home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE03 / CONSTRUC / TREDIT.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1995-07-06  |  1.8 KB  |  81 lines

  1. unit Tredit;
  2. interface
  3. uses
  4.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  5.   Forms, Menus, Dialogs, StdCtrls;
  6.  
  7. type
  8.   TRightEdit = class(TCustomMemo)
  9.   private
  10.     { Private declarations }
  11.   protected
  12.     { Protected declarations }
  13.   public
  14.     { Public declarations }
  15.     constructor Create(AOwner: TComponent); override;
  16.     procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
  17.   published
  18.     { Published declarations }
  19.   { property AutoSelect; }
  20.   { property AutoSize; }
  21.     property BorderStyle;
  22.     property CharCase;
  23.     property Color;
  24.     property Ctl3D;
  25.     property Cursor;
  26.     property DragCursor;
  27.     property DragMode;
  28.     property Enabled;
  29.     property Font;
  30.     property Height;
  31.     property HelpContext;
  32.     property HideSelection;
  33.     property Hint;
  34.     property Left;
  35.     property MaxLength;
  36.     property Name;
  37.     property OEMConvert;
  38.     property ParentColor;
  39.     property ParentCtl3D;
  40.     property ParentFont;
  41.     property ParentShowHint;
  42.   { property PasswordChar; }
  43.     property PopupMenu;
  44.     property ReadOnly;
  45.     property ShowHint;
  46.     property TabOrder;
  47.     property Tag;
  48.     property Text;
  49.     property Top;
  50.     property Visible;
  51.     property Width;
  52.   end;
  53.  
  54. procedure Register;
  55.  
  56. implementation
  57.  
  58. constructor TRightEdit.Create(AOwner: TComponent);
  59. begin
  60.   inherited Create(AOwner);
  61.   Align := alNone;
  62.   Alignment := taRightJustify;
  63.   ScrollBars := ssNone;
  64.   WantReturns := False;
  65.   WantTabs := False;
  66.   WordWrap := False;
  67. end;
  68.  
  69. procedure TRightEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
  70. begin
  71.   if AHeight > (2 * abs(Font.Height)) then AHeight := 2 * abs(Font.Height);
  72.   inherited SetBounds(ALeft, ATop, AWidth, AHeight);
  73. end;
  74.  
  75. procedure Register;
  76. begin
  77.   RegisterComponents('Dr.Bob', [TRightEdit]);
  78. end;
  79.  
  80. end.
  81.